package com.itheima;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Function;

public class myfunctionDemo02 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Collections.addAll(list,new Student("张三",23),new Student("李四",24),new Student("王五",25));

        list.stream().map(new Function<Student, String>() {
            @Override
            public String apply(Student student) {
                return student.getName();
            }
        }).toArray(String[]::new);

    }
}
